export const key = 'goodsdata';
export var valueObj = {goodsid:0,count:0};
 export function setItem(value){
	var json = localStorage.getItem(key);
	json = json || "[]";
	var arr = JSON.parse(json);
	arr.push(value);
	localStorage.setItem(key,JSON.stringify(arr));
};
export function getItem(){
	var json = localStorage.getItem(key);
	json = json || "[]";
	return JSON.parse(json);
};
export function removeItem(goodsid){
	var arr = getItem();
	for(var i = arr.length; i >=0 ; i--){
		if(arr[i].goodsid==goodsid){
			arr.slice(i,1);
		}
	};
	localStorage.setItem(key,JSON.stringify(arr))
}
